In information theory, data compression or source coding is a process of encoding information using fewer bits than an unencoded representation would use through use of specific encoding schemes. For example, a text could be encoded with fewer bits if one were to accept the convention that the word “compression” be encoded as “comp.” One conventional instance of compression with which many computer users are familiar is the “ZIP” file format, which, as well as providing compression, acts as an archiver, storing many files in a single output file.
As with any communication, compressed data communication only works when both the sender and receiver of the information understand the encoding scheme. For example, a text makes sense only if a receiver understands that it is intended to be interpreted as characters representing the English language. Similarly, compressed data can only be understood if the decoding method is known by the receiver.
Compression is useful because it helps reduce the consumption of expensive resources, such as memory or transmission bandwidth. On the downside, compressed data must be decompressed to be viewed (or heard). This extra decompression processing may be detrimental to some applications. For instance, a compression scheme for video may require expensive hardware for the video to be decompressed fast enough to be viewed as it is being decompressed (the option of decompressing the video in full before watching it may be inconvenient, and requires storage space for the decompressed video). Data compression schemes therefore involves trade-offs among various factors, including memory, the degree of compression, the amount of distortion introduced (if using a lossy compression scheme), and the computational resources required to compress and decompress the data.